package com.tina.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tina.entity.Flowers;
import com.tina.exception.CustomerException;

import java.util.List;

/**
 * <p>
 * 商品表 服务类
 * </p>
 *
 * @author Tina
 * @since 2020-10-26
 */
public interface IFlowersService extends IService<Flowers> {

    /**
     * 新增商品
     *
     * @param flowers
     * @return
     */
    Integer insertFood(Flowers flowers);

    /**
     * 编辑商品
     *
     * @param flowers
     * @return
     */
    Integer editFood(Flowers flowers);

    /**
     * 查询商品
     *
     * @param flowers
     * @return
     */
    List<Flowers> selectFlowers(Flowers flowers);

    /**
     * 通过商品ID查询
     *
     * @param flowersId
     * @return
     */
    Flowers selectFlowersById(Integer flowersId);

    /**
     * 校验商品是否存在
     *
     * @return
     */
    public void checkFood(Integer flowersId) throws CustomerException;

    /**
     * 扣减库存
     *
     * @param flowers 商品
     * @return
     */
    public void reduceGoodsNum(Flowers flowers) throws Exception;
}
